package main;

import redis.clients.jedis.Jedis;

import java.util.List;
import java.util.Set;

public class RedisKeyJava {
   public static void main(String[] args) {
      //连接本地的 Redis 服务
      Jedis jedis = new Jedis("localhost");
      System.out.println("Connection to server sucessfully");

     // 获取数据并输出
     Set<String> set = jedis.keys("*");
     for(String key:set){
         System.out.println(key);
     }
   }
}